Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt RpcClient to recent token method changes #11519

Merged
merged 2 commits into from
Aug 11, 2020

Conversation

mvines
Copy link
Member

@mvines mvines commented Aug 11, 2020

Recent token RPC methods allow for some RpcClient clientup that spl-token-cli requires

#[serde(skip_serializing_if = "UiTokenAmount::is_zero")]
pub delegated_amount: UiTokenAmount,
#[serde(skip_serializing_if = "Option::is_none")]
pub delegated_amount: Option<UiTokenAmount>,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without the Option, you can't deserialize a UiTokenAccount in Rust. Ran into this in the spl-token-cli

@@ -703,103 +699,6 @@ impl RpcClient {
Ok(hash)
}

pub fn get_token_account(&self, pubkey: &Pubkey) -> ClientResult<Option<UiTokenAccount>> {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nuke things I added in for spl-token-cli but no longer need because the decimals is returned from RPC directly now

})

let config = RpcAccountInfoConfig {
encoding: Some(UiAccountEncoding::JsonParsed),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mvines mvines added the CI Pull Request is ready to enter CI label Aug 11, 2020
@solana-grimes solana-grimes removed the CI Pull Request is ready to enter CI label Aug 11, 2020
@mvines mvines closed this Aug 11, 2020
@mvines mvines reopened this Aug 11, 2020
@mvines mvines added the CI Pull Request is ready to enter CI label Aug 11, 2020
@solana-grimes solana-grimes removed the CI Pull Request is ready to enter CI label Aug 11, 2020
@mvines mvines added the CI Pull Request is ready to enter CI label Aug 11, 2020
@solana-grimes solana-grimes removed the CI Pull Request is ready to enter CI label Aug 11, 2020
@mvines mvines added the CI Pull Request is ready to enter CI label Aug 11, 2020
@solana-grimes solana-grimes removed the CI Pull Request is ready to enter CI label Aug 11, 2020
@codecov
Copy link

codecov bot commented Aug 11, 2020

Codecov Report

Merging #11519 into master will increase coverage by 0.0%.
The diff coverage is 37.5%.

@@           Coverage Diff           @@
##           master   #11519   +/-   ##
=======================================
  Coverage    81.8%    81.9%           
=======================================
  Files         327      327           
  Lines       75559    75469   -90     
=======================================
+ Hits        61834    61835    +1     
+ Misses      13725    13634   -91     

@t-nelson
Copy link
Contributor

Looks like CI is being held up by a Travis "PR double build" https://docs.travis-ci.com/user/pull-requests/#double-builds-on-pull-requests

It should be safe to merge once reviewed

@CriesofCarrots CriesofCarrots merged commit 17645ee into solana-labs:master Aug 11, 2020
mergify bot pushed a commit that referenced this pull request Aug 11, 2020
* Avoid skip_serializing_if since that breaks deserialization

* Adapt RpcClient to recent token method changes

(cherry picked from commit 17645ee)

# Conflicts:
#	client/src/rpc_client.rs
mergify bot pushed a commit that referenced this pull request Aug 11, 2020
* Avoid skip_serializing_if since that breaks deserialization

* Adapt RpcClient to recent token method changes

(cherry picked from commit 17645ee)
mergify bot added a commit that referenced this pull request Aug 11, 2020
* Avoid skip_serializing_if since that breaks deserialization

* Adapt RpcClient to recent token method changes

(cherry picked from commit 17645ee)

Co-authored-by: Michael Vines <[email protected]>
mergify bot added a commit that referenced this pull request Aug 11, 2020
* Adapt RpcClient to recent token method changes (#11519)

* Avoid skip_serializing_if since that breaks deserialization

* Adapt RpcClient to recent token method changes

(cherry picked from commit 17645ee)

# Conflicts:
#	client/src/rpc_client.rs

* Fix conflicts

Co-authored-by: Michael Vines <[email protected]>
Co-authored-by: Tyera Eulberg <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants